<?
	require_once "../../_func/__Global.php";
	require_once "../../_func/__Local.php";
	require_once "../../_func/__MysqlFunc.php";
	require_once "../../_func/_BoardFunc.php";
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>:: 농협전북지부 ERP시스템 ::</title>
<link href="/css/layout.css" type="text/css" rel="stylesheet" />
</head>
<body>
<div id="wrap">

	<!-- header start -->
	<? include("../_layout/head.inc"); ?>
	<!-- header end -->


<?
	$b = $param->getString("b");
	$page = $param->getNumber('page');
	$qtype = $param->getString('qtype');
	$query = $param->getString('query');
	$no = $param->getNumber('no');
	$menu1 = $param->getString('menu1');
	$menu2 = $param->getString('menu2');
	
	$isOwner = false;

	$basic_param = array(
		'b'				=> $b,
		'page'			=> $page,
		'qtype'			=> $qtype,
		'query'			=> $query,
		'menu1'			=> $menu1,
		'menu2'			=> $menu2,	
	);

	$row =& TalkBoard_GetArticle($b, $no);
?>
<script src="/js/bbs.js"></script>


<!-- container start -->
	<div id="container"> 
    	<div class="subtit">
        	<p class="<?= $subtt_class?>"><span>게시판 > <?= $bbs_name?></span></p>
		</div>
<?
	if ( $row != null  )
	{
		$tid						= $row->getNumber('tid');
		$writer_id				= $row->getString('writer_id');
		$writer_name			= $row->getString('writer_name');
		$delete_flag			= $row->getNumber('delete_flag');
		$subject				= $row->getString('subject');
		$content				= $row->getString('content');
		$hit_count				= $row->getNumber('hit_count');
		$reg_date				= $row->getString('reg_date');
		$upload_file0			= $row->getString('upload_file0');
		
		$isOwner = IsOwner(GetCurrentUser(), $writer_id); 

		$suffix = '';
		if ( $upload_file0 != '' )
		{
			$suffix = preg_replace('!^(.*\.)!', '', $upload_file0);
			$suffix = strtolower($suffix);
			if ( $suffix == 'gif' || $suffix == 'jpg' || $suffix == 'png' )
				$upload_file0 = rawurlencode($upload_file0);
		}

		$parambase = encodeParamArray($basic_param);
		if ($parambase) {
			$urlbase = $parambase . "&";
		}
?>
        <div class="contents">
<iframe name=if_nvl id=if_nvl src='' style='display:none'></iframe>
        	<table cellpadding="0" cellspacing="1" border="0" class="bbsTable">
<form name=frm id=frm method=post action=''  enctype="multipart/form-data">
<input type=hidden name=b value='<?echo $b?>'>
<input type=hidden name=page value='<?echo $page?>'>
<input type=hidden name=qtype value='<?echo $qtype?>'>
<input type=hidden name=query value='<?echo $query?>'>
<input type=hidden name=urlbase value='<?echo $urlbase?>'>
<input type=hidden name=n value='<?echo $no?>'>
<input type=hidden name=m value='u'>
<input type=hidden name=menu1 value='<?echo $menu1?>'>
<input type=hidden name=menu2 value='<?echo $menu2?>'>
            	<colgroup>
				<col width="120px" />
                <col width="*" />
                <col width="120px" />
                <col width="*" />
                <col width="120px" />
                <col width="*" />
                </colgroup>
            	<tr>	
                    <th>제목</th>
                    <td class="title" colspan="5"><input type="text" name="subject" id="subject" value="<?echo $subject?>" class="boxinput w97p" /></td>
				</tr>
                <tr>	
                    <th>작성자명</th>
                    <td class="title" colspan="5"><input type="text" name="writer_name" id="writer_name" value="<?echo $writer_name?>" class="boxinput w97p" /></td>
				</tr>

                <tr>
                	<td colspan="6" class="writebox">
						<textarea name="content" style="border:1px solid #999999; width:99%;margin:5px 0px 0px 0px;padding:0px 0px 0px 0px;" rows="15" ><?echo $content?></textarea>
					</td>
                </tr>                
                <tr>	
                    <th>파일첨부</th>
                    <td class="title" colspan="5"><input type="file" name="upload_file0" id="upload_file0" class="boxinput"/></td>
				</tr>
			</table>
            
            <div class="BtnList">
            	<ul>
            	<? if ($isOwner) {?>
                	<li><input type="button" class="btn_submit" onClick="sndFrm();"title="수정"/></li>
            	<? }?>
                	<li><input type="button" class="btn_cancel" onClick="rstFrm();" title="취소"/></li>
                </ul>
            </div>

        </div>
<?
	}
?>

    </div>
<!-- container 끝 -->    

	<!-- footer start -->
	<? include("../_layout/footer.inc"); ?>
	<!-- footer end -->
   
</div>
</body>
</html>
